package model.impl;

import sharedGameLogic.enums.BattleEvent;
import sharedGameLogic.players.BattleStatus;

public abstract class ActionBuilder {
	protected float attackStrengthModifier;
	protected float attackSpeedModifier;
	protected float attackPrecisionModifier;
	protected float dodgeModifier;
	protected float blockModifier;
	protected float magicalStrengthModifier;
	protected float magicalPrecisionModifier;
	
	protected BattleEvent actionType;
	
	protected BattleAction action;
	
	public void createNewAction(BattleStatus attributes){
		action = new BattleAction(
				Math.round(attributes.getAttackStrength() * attackStrengthModifier),
				Math.round(attributes.getAttackSpeed() * attackSpeedModifier),
				Math.round(attributes.getAttackPrecision() * attackPrecisionModifier),
				Math.round(attributes.getDodge() * dodgeModifier),
				Math.round(attributes.getBlock() * blockModifier),
				Math.round(attributes.getMagicalStrength() * magicalStrengthModifier),
				Math.round(attributes.getMagicalPrecision() * magicalPrecisionModifier),
				actionType);
	}
	
	public BattleAction getActionProduct(){
		return action;
	}
}
